#import "animal.h"

@implementation Animal

- (void) setWeight: (double) w
{
    weight = w;
}

- (double) getWeight
{
    return weight;
}

- (void) setPosX: (double) xValue setPosY: (double) yValue;
{
    x = xValue;
    y = yValue;
}

- (double) getPosX
{
    return x;
}

- (double) getPosY
{
    return y;
}

- (id) reproduce: (id) other
{
    id little = [[[self class] alloc] init];
    
    if ([self class] == [other class])
        [little setWeight: [other getWeight]/2];
    else
        [little setWeight: 0];

    return little;
}

@end
